{include file="header" title="$title" /}
    <div class="i-card-main">
        <p><i class="iconfont icon-page"></i> NOTIFY PAGE</p>
    </div>
    <div class="i-card-main">
        <div class="i-card-title">
            <p>Notify</p>
        </div>
        <div class="notifyList"></div>
    </div>
    <nav id="page" style="display: none;">
        <ul class="pagination justify-content-center">
        </ul>
    </nav>
</div>
{include file="footer" /}
<script>
$(".loading").show();
$(".i-card-main").eq(1).hide();

$(document).ready(function(){
    $.get("/api/v1/getAllNotify?page=" + page, function(res){
        if(res.code != 200 ){
            layer.msg(res.msg);
            $(".loading").hide();
            return;
        }

        const data = res.data.data;
        let html = "";
        for(let i = 0; i < data.length; i++){
            const time = timestampToTime(data[i].time).split(" ");
            html += "<div class='media'><span><span>"+ time[0] +"</span><br><span>"+ time[1] +"</span></span><hr><div class='media-body'><h5 class='mt-0'>"+ data[i].title +"</h5><p>"+ data[i].content +"</p></div></div>";
        }
        $(".notifyList").html(html);
        setTimeout(function () {
            $(".loading").hide();
            $(".i-card-main").eq(1).show();
            pages(res)
        }, 500);
    });
});
</script>
</body>
</html>